package com.example.datn.activities;

import java.util.List;

import com.example.datn.adapter.NewsAdapter;
import com.example.datn.objects.RssObject;
import com.example.datn.utils.Variables;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class ListTintucActivity extends ListActivity{
	private List<RssObject> item;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		Bundle bundle= getIntent().getExtras();
		int catelogy=bundle.getInt("paper");
		setTitle("hihi"+catelogy);
		int key =  catelogy;
		item =Variables.newsMap.get(key);
	NewsAdapter adapter=new NewsAdapter(ListTintucActivity.this, Variables.ICONS[catelogy], item);
	setListAdapter(adapter);
	
	
	}
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {

		super.onListItemClick(l, v, position, id);
	Intent intent=new Intent(ListTintucActivity.this,WebTinTucActivity.class);
intent.putExtra("LINK",item.get(position).getLink());
startActivity(intent);
	}
}
